home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
u_man
/
cat1
/
squeeze.z
/
squeeze
Wrap
Text File
|
1998-10-30
|
4KB
|
133 lines
SSSSQQQQUUUUEEEEEEEEZZZZEEEE((((1111)))) SSSSQQQQUUUUEEEEEEEEZZZZEEEE((((1111))))
NNNNAAAAMMMMEEEE
squeeze - squeeze memory from the system
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
ssssqqqquuuueeeeeeeezzzzeeee [flag] amount
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_s_q_u_e_e_z_e will allocate a region of its virtual memory of a size given by
its arguments, and lock that virtual memory down into real memory, thus
making it unavailable to other processes. It can only be used by the
superuser.
The amount of memory locked is specified as an integer argument, in units
given by the flag argument. By default it is in megabytes (-m flag). A
flag of -p, implies that the amount is in pages; a flag of -k implies
that the amount in kilobytes; and a flag of -% implies a percentage of
the installed memory.
Once the memory is locked down, _s_q_u_e_e_z_e prints a message on stdout saying
how much is locked, and sleeps indefinitely. It can be interrupted by
SIGINT or SIGTERM, at which time it frees up the memory and exits. The
user should wait until after this message is printed before doing any
experiments.
UUUUSSSSAAAAGGGGEEEE
_s_q_u_e_e_z_e can be used to determine the approximate working set of a
program. To do so, use a machine which has enough physical memory to
allow your target application to run without any paging (other than
startup). This can be determined by using the command _s_s_u_s_a_g_e to spawn
your application. When the application exits, its resource usage is
printed; the value labeled majf gives the number of major page faults,
that is the number of faults that required a physical read to satisfy.
When run on a machine with a large amount of physical memory, this value
is the number of faults needed to start the program, which is the minimum
number for any run.
Then run _s_q_u_e_e_z_e to lock down varying amounts of memory, and rerun the
program. The major-fault number will remain low at first, but as you
squeeze out more and more memory, it will rise. The amount of physical
memory in the system minus the amount of memory squeezed at point at
which your application begins to page-fault tells you the combined
working set of your program, the kernel, and all other applications you
normally have running. If you have previously done this on a program
whose paging behavior is well understood, you can determine the working
set of the kernel and your normal environment, and by subtraction, the
working set of the application you are studying.
One program that can be used for this purpose is thrash(1). It allocates
a large block of memory, and then sequentially accesses each page in the
block. For all practical purposes, the working set of this program is
the size of the memory allocated.
PPPPaaaaggggeeee 1111
SSSSQQQQUUUUEEEEEEEEZZZZEEEE((((1111)))) SSSSQQQQUUUUEEEEEEEEZZZZEEEE((((1111))))
SSSSEEEEEEEE AAAALLLLSSSSOOOO
ssusage(1), thrash(1)
PPPPaaaaggggeeee 2222